package cubelabs.nexus.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cubelabs.nexus.entity.Invitation;
import cubelabs.nexus.entity.Review;
import cubelabs.nexus.entity.User;
import cubelabs.nexus.entity.Viewer;

@Repository("viewerDAO")
public class ViewerDAO extends BaseDAO<Viewer, Long>{
	public List<Viewer> findByUserId(Long userId){
		List<Viewer> viewers = findByCriteria(Restrictions.eq("user.id", userId));
		return viewers;
	}
}
